package com.harassment.interception.ui.fragments.bottomFragment;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.design.widget.BottomNavigationView;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.harassment.interception.R;

public class BottomOperateFragment extends Fragment implements View.OnClickListener{
    private ImageView selectAll;
    private ImageView selectClose;
    private ImageView selectDelete;
    private OperateBarOnClick mOperateBarOnClick;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_operate_bar, container, false);
        selectAll = view.findViewById(R.id.select_all);
        selectClose = view.findViewById(R.id.select_close);
        selectDelete = view.findViewById(R.id.select_delete);

        selectAll.setOnClickListener(this);
        selectClose.setOnClickListener(this);
        selectDelete.setOnClickListener(this);
        return view;
    }

    @Override
    public void onClick(View v) {
        if (mOperateBarOnClick == null) {
            return;
        }
        mOperateBarOnClick.onClick(v);
    }

    public interface OperateBarOnClick{
        public abstract void onClick(View view);
    }

    public OperateBarOnClick getOperateBarOnClick() {
        return mOperateBarOnClick;
    }

    public void setOperateBarOnClick(OperateBarOnClick operateBarOnClick) {
        mOperateBarOnClick = operateBarOnClick;
    }
}
